﻿<UserControl x:Class="HomeViewGraphs.Graphs"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="750" Height="600"
    xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:System_Windows_Controls_DataVisualization_Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
>

    <UserControl.Resources>
        <Style x:Key="ToolTipStyle" TargetType="chartingToolkit:ColumnDataPoint"  >
            <Setter Property="Background" Value="#FF4D4F82" />
            <Setter Property="BorderBrush" Value="Black" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="chartingToolkit:ColumnDataPoint" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
                        <Border ToolTipService.ToolTip="{Binding DataContext, Path=InvestmentCategory}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" x:Name="Root" >
                                <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.1" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="MouseOverHighlight" Storyboard.TargetProperty="Opacity" To="0.6" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.1" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Unselected" />
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="SelectionHighlight" Storyboard.TargetProperty="Opacity" To="0.6" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="RevealStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.5" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Shown">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Hidden">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid Background="{TemplateBinding Background}">
                                <Rectangle>
                                    <Rectangle.Fill>
                                        <LinearGradientBrush>
                                            <GradientStop Color="#77ffffff" Offset="0" />
                                            <GradientStop Color="#00ffffff" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Border BorderBrush="#ccffffff" BorderThickness="1">
                                    <Border BorderBrush="#77ffffff" BorderThickness="1" />
                                </Border>
                                <Rectangle x:Name="SelectionHighlight" Fill="Red" Opacity="0" />
                                <Rectangle x:Name="MouseOverHighlight" Fill="White" Opacity="0" />
                            </Grid>
                           
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="SecondToolTipStyle" TargetType="chartingToolkit:ColumnDataPoint"  >
            <Setter Property="Background" Value="#FF9D5A5A" />
            <Setter Property="BorderBrush" Value="Black" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="chartingToolkit:ColumnDataPoint" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
                        <Border ToolTipService.ToolTip="{Binding DataContext, Path=InvestmentCategory}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" x:Name="Root" >
                                <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.1" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="MouseOverHighlight" Storyboard.TargetProperty="Opacity" To="0.6" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.1" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Unselected" />
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="SelectionHighlight" Storyboard.TargetProperty="Opacity" To="0.6" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="RevealStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.5" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Shown">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Hidden">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid Background="{TemplateBinding Background}">
                                <Rectangle>
                                    <Rectangle.Fill>
                                        <LinearGradientBrush>
                                            <GradientStop Color="#77ffffff" Offset="0" />
                                            <GradientStop Color="#00ffffff" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Border BorderBrush="#ccffffff" BorderThickness="1">
                                    <Border BorderBrush="#77ffffff" BorderThickness="1" />
                                </Border>
                                <Rectangle x:Name="SelectionHighlight" Fill="Red" Opacity="0" />
                                <Rectangle x:Name="MouseOverHighlight" Fill="White" Opacity="0" />
                            </Grid>
                           
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="TitleStyle" TargetType="visualizationToolkit:Title">
            <Setter Property="FontSize" Value="12"></Setter>
            <Setter Property="FontFamily" Value="Arial"></Setter>
            <Setter Property="FontWeight" Value="Bold"></Setter>
            <Setter Property="HorizontalAlignment" Value="Center"></Setter>
        </Style>
        <Style x:Key="LeftTitleStyle" TargetType="visualizationToolkit:Title">
            <Setter Property="FontSize" Value="12"></Setter>
            <Setter Property="FontFamily" Value="Arial"></Setter>
            <Setter Property="FontWeight" Value="Bold"></Setter>
            <Setter Property="HorizontalAlignment" Value="Left"></Setter>
            <Setter Property="Margin" Value="70,0,0,0"></Setter>
        </Style>
        <Style x:Key="ProjectTitleStyle" TargetType="visualizationToolkit:Title">
            <Setter Property="FontSize" Value="12"></Setter>
            <Setter Property="FontFamily" Value="Arial"></Setter>
            <Setter Property="FontWeight" Value="Bold"></Setter>
            <Setter Property="HorizontalAlignment" Value="Left"></Setter>
            <Setter Property="Margin" Value="40,0,0,0"></Setter>
        </Style>

    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="55*" />
            <ColumnDefinition Width="45*"/>

        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50*"/>
            <RowDefinition Height="50*"/>
        </Grid.RowDefinitions>

        <chartingToolkit:Chart BorderBrush="{x:Null}" Height="300" TitleStyle="{StaticResource LeftTitleStyle}"   x:Name="BudgetSummary"  DataContext="{Binding}" >

        </chartingToolkit:Chart>

        <chartingToolkit:Chart BorderBrush="{x:Null}" Grid.Column="1" Height="300" TitleStyle="{StaticResource TitleStyle}" Grid.Row="1" x:Name="IdeationChart" Title="Ideation Chart" DataContext="{Binding}" >
            <chartingToolkit:Chart.LegendStyle>
                <Style TargetType="visualizationToolkit:Legend">
                    <Setter Property="Width" Value="0"/>
                    <Setter Property="Height" Value="0"/>
                </Style>
            </chartingToolkit:Chart.LegendStyle>


        </chartingToolkit:Chart>
        <chartingToolkit:Chart BorderBrush="{x:Null}" Grid.Column="1" TitleStyle="{StaticResource TitleStyle}" Grid.Row="0" Height="300"  x:Name="NewJobsChart"  DataContext="{Binding}" >

            <chartingToolkit:Chart.LegendStyle>
                <Style TargetType="visualizationToolkit:Legend">
                    <Setter Property="Width" Value="0"/>
                    <Setter Property="Height" Value="0"/>
                </Style>
            </chartingToolkit:Chart.LegendStyle>

        </chartingToolkit:Chart>
        <chartingToolkit:Chart BorderBrush="{x:Null}" Grid.Column="0" Grid.Row="1" Height="300" TitleStyle="{StaticResource ProjectTitleStyle}" x:Name="ProjTrend" Title="Project Execution Trend By Month" DataContext="{Binding}" />

    </Grid>
</UserControl>
